#include "system_config.h"
#include "stm32l052_lp_mode.h"

volatile uint32_t schedule_time = 0;


extern const task_register_t test_1;

const task_register_t* task_buf[] = {
    &test_1,

};

const uint8_t task_number =
    sizeof(task_buf) / sizeof(task_buf[0]);

void loop(void)
{
    uint32_t i = 0;
 
    schedule_time = get_time();
    
    for(i = 0; i < task_number; i++){
        if((schedule_time % task_buf[i]->task_period) == 0){
            task_buf[i]->func();
        }
    }
    
}



